package com.king.designpatterns.hybriddesignpattern.hybriddesignpattern.factorystrategypatterns;

/**
 * 策略工厂
 *
 * @author king
 * @date 2021-06-13 23:17
 */
public class StrategyFactory {
    public static IDeduction getDeduction(StrategyMan strategyMan){
        IDeduction deduction = null;
        try {
            deduction = (IDeduction) Class.forName(strategyMan.getValue()).newInstance();
        } catch (Exception e){
            e.printStackTrace();
        }
        return deduction;
    }
}
